package lang4j.generator;

import org.apache.commons.lang.StringUtils;
import lang4j.parser.generated.*;

/**
 * User: felix
 * Date: 08.11.2005
 * Time: 19:24:23
 */
public class ProductionTestInfo {
    Production production;


    String type;

    public ProductionTestInfo(final Production production) {
        this.production = production;
        production.accept(new ProductionVisitor() {
            public void visitEnumProduction(EnumProduction enumProduction) {
                type=getCapName();
            }

            public void visitTypeProduction(TypeProduction typeProduction) {
                type=getCapName();
            }

            public void visitListProduction(ListProduction listProduction) {
                type= "java.util.List";
            }
        });

    }

    public String getName(){
        return production.getName();
    }

    public String getCapName(){
        return StringUtils.capitalize(production.getName());
    }

    public String getType() {
        return type;
    }

}
